# Default values for fastnginx.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
  repository: nginx
  pullPolicy: IfNotPresent
  # Overrides the image tag whose default is the chart appVersion.
  tag: "1.21.6"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

initContainer:
  image: busybox:1.33.0
  pullPolicy: IfNotPresent


podAnnotations: {}

podSecurityContext: {}
  # fsGroup: 2000

securityContext:
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000
  runAsNonRoot: true
  ## User nginx in container nginx
  runAsUser: 101

service:
  type: ClusterIP
  port: 80

ingress:
  enabled: false
  className: ""
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths:
        - path: /
          pathType: Prefix
  tls: []
  #  - secretName: chart-example-tls
  #    hosts:
  #      - chart-example.local

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #   cpu: 100m
  #   memory: 128Mi
  # requests:
  #   cpu: 100m
  #   memory: 128Mi

nodeSelector: {}

tolerations: []

affinity: {}

# Port like a parameter listen in default.conf below
containerPort: 8080

confd:
  default: |
    server {
      listen       8080;
      # listen  [::]:8080;
      server_name  localhost;
      location / {
      root   /usr/share/nginx/html;
      index  index.html index.htm;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
      root   /usr/share/nginx/html;
      }
    }

nginxconf: |
  user  nginx;
  worker_processes  auto;

  error_log  /var/log/nginx/error.log notice;
  pid        /var/run/nginx.pid;


  events {
      worker_connections  1024;
  }


  http {
      include       /etc/nginx/mime.types;
      default_type  application/octet-stream;

      log_format nginx_json escape=json
          '{'
          '"time_local":"$time_local",'
          '"http_host":"$http_host",'
          '"request":"$request",'
          '"status": "$status",'
          '"body_bytes_sent":"$body_bytes_sent",'
          '"request_time":"$request_time",'
          '"upstream_response_time":"$upstream_response_time",'
          '"upstream_response_length":"$upstream_response_length",'
          '"upstream_connect_time":"$upstream_connect_time",'
          '"upstream_status":"$upstream_status",'
          '"upstream_addr":"$upstream_addr",'
          '"http_referrer":"$http_referer",'
          '"http_user_agent":"$http_user_agent",'
          '"request_body":"$request_body",'
          '"request_length":"$request_length",'
          '"remote_ip":"$http_x_forwarded_for",'
          '"remote_addr":"$remote_addr",'
          '"request_uri":"$request_uri",'
          '}';

      access_log  /dev/stdout  nginx_json;
      error_log   /dev/stderr  warn; # warn, error crit, alert, and emerg

      sendfile        on;
      #tcp_nopush     on;

      keepalive_timeout  65;

      #gzip  on;

      include /etc/nginx/conf.d/*.conf;
  }

html:
  index: |
    <html>
    <head>
        <title>Fast nginx deployment</title>
        <meta charset="UTF-8">
    </head>
    <body>
    <h1>Fast nginx deployment</h1>
    </body>
    </html>
  50x: |
    <!DOCTYPE html>
    <html>
    <head>
        <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
        <meta content="utf-8" http-equiv="encoding">
        <title>Error</title>
        <style>
            body {
                width: 35em;
                margin: 0 auto;
                font-family: Tahoma, Verdana, Arial, sans-serif;
            }
        </style>
    </head>
    <body>
    <h1>An error occurred.</h1>
    <p>Sorry, the page you are looking for is currently unavailable.<br/>
        Please try again later.</p>
    </body>
    </html>
